package com.ruoyi.web.controller.admin;

import com.alibaba.fastjson2.JSONArray;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.utils.uuid.IdUtils;
import com.ruoyi.system.domain.xcx.AppUser;
import com.ruoyi.system.domain.xcx.DouyinApl;
import com.ruoyi.system.domain.xcx.Goods;
import com.ruoyi.system.service.IAppUserService;
import com.ruoyi.system.service.IGoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 用户管理
 *
 * @author ruoyi
 * @date 2023-09-30
 */
@RestController
@RequestMapping("/douyin/AppUser")
public class AppUserController extends BaseController
{
    @Autowired
    private IAppUserService appUserService;
    @Autowired
    private RedisCache redisCache;
    /**
     * 查询用户列表
     */
    @GetMapping("/list")
    public TableDataInfo list(AppUser appUser)
    {
        startPage();
        List<AppUser> list = appUserService.selectAppUserList(appUser);
        return getDataTable(list);
    }

    /**
     * 调整用户权限
     */
    @Log(title = "小程序应用平台", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody AppUser appUser)
    {
        return toAjax(appUserService.updateAppUser(appUser));
    }
}
